package com.igeek.collateral.mapper;

import com.igeek.collateral.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * <p>
 * 角色 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-07-04
 */
public interface RoleMapper extends BaseMapper<Role> {
    @Select("select r.* from role r join user_role ur on r.id = ur.role_id where ur.user_id = #{userId}")
    public Set<Role> selectRolesByUserId(Integer userId);
}
